@echo off
echo ========================================
echo 滴滴智能客服系统完整启动
echo ========================================

echo.
echo 1. 启动Elasticsearch...
net start "Elasticsearch" > nul 2>&1
if %errorlevel% equ 0 (
    echo ✅ Elasticsearch启动成功
) else (
    echo ⚠️  Elasticsearch启动失败，请手动启动
    echo 请运行: start_elasticsearch.bat
)

echo.
echo 2. 等待ES服务启动...
timeout /t 5 /nobreak > nul

echo.
echo 3. 启动Django后端服务...
start "Django Backend" cmd /k "python manage.py runserver"

echo.
echo 4. 等待后端服务启动...
timeout /t 3 /nobreak > nul

echo.
echo 5. 启动定时数据收集服务...
start "Data Scheduler" cmd /k "python ai/scripts/scheduled_data_collection.py"

echo.
echo 6. 启动Vue前端服务...
cd /d "D:\PY\car_user\diweb"
start "Vue Frontend" cmd /k "npm run dev"

echo.
echo ========================================
echo 系统启动完成！
echo ========================================
echo.
echo 服务地址：
echo - 前端界面: http://localhost:5173
echo - 后端API: http://localhost:8000
echo - Elasticsearch: http://localhost:9200
echo.
echo 智能客服功能：
echo - 点击右下角"智能客服"按钮
echo - 查看知识库统计信息
echo - 使用快捷问题或自定义提问
echo.
echo 定时任务：
echo - 每日凌晨2点: 数据收集
echo - 每周日凌晨3点: 完整数据收集
echo - 每小时: 健康检查
echo.
pause 